#include <master.h>
#include <debug.h>
#include <sched.h>

// just in case

void dummythreada(char * someothernumber) {
 while (1) { 
//  dprint("Inside thread %c\n", *someothernumber);
  putch(*someothernumber); 
 }
}

void dummythreadb(char * number) {
// dprint("Inside thread %c\n", number);
 putch(*number); 
}

void kmain(unsigned int mboot, multiboot_info_t * mbinfo)
{

 debug_init();
 dprint("SekiOS debugger\n");

 init_video();

#include "logo.i"
 kprint("SekiOS II dev edition.\n");
 if (mboot != 0x2badb002) panic("Multiboot = mangled!");

 do_cpuid_test();

 setup_mm(mbinfo);
// panic("ok");
  
 printf("Setup GDT/TSS\n"); 
 gdt_install();

 printf("Setup IDT\n"); 
 idt_install();

 printf("Setup ISRs\n"); 
 isrs_install();

 printf("Setup IRQs\n"); 
 irq_install();
 enable_irqs();

 printf("IRQs and fault handling is good to go!\n");
 
 timer_install();
 rtc_install();
 kbd_install();
 
  
 sched_install();

 // ID 0 - IDLE THREAD LULZ
 
 while(1) { __asm__ ("hlt"); } 
}

